<%--
  Created by IntelliJ IDEA.
  User: 董鹏超
  Date: 2021/4/6
  Time: 17:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <script src="../static/js/jquery/jquery-2.1.4.min.js" type="text/javascript"></script>
    <script src="../static/layui/layui.js" type="text/javascript"></script>
    <script src="../static/js/index/index.js" type="text/javascript"></script>
    <script src="../static/js/index/freezeheader.js" type="text/javascript"></script>
    <script src="../static/layui/lay/modules/layer.js" type="text/javascript"></script>
    <script src="../static/js/index/sliders.js" type="text/javascript"></script>
    <script src="../static/js/index/html5.js" type="text/javascript"></script>
    <script src="../static/js/index/article_pub.js" type="text/javascript"></script>
    <link rel="stylesheet" href="../static/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="../static/layui/css/modules/layer/default/layer.css"/>
    <link rel="stylesheet" href="../static/css/global.css"/>
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<%@ include file="header.jsp" %>
<div class="layui-container container">
    <div style="text-aglin:center;">
        <form class="layui-form " enctype="multipart/form-data" method="post" style="text-aglin:center;" action="/student/submitQuestion" >

            <div class="layui-form-item">
                <label class="layui-form-label">选择提问科目</label>
                <div class="layui-inline">
                    <select name="subject" lay-filter="subject">
                        <option value="请选择提问科目"></option>
                        <option value="数据结构">数据结构</option>
                        <option value="Java">Java</option>
                        <option value="C++">C++</option>
                        <option value="大数据">大数据</option>
                        <option value="python">python</option>
                        <option value="go">go</option>
                        <option value="区块链">区块链</option>
                        <option value="计算机网络">计算机网络</option>
                        <option value="计算机基础">计算机基础</option>
                        <option value="计算机组成原理">计算机组成原理</option>
                        <option value="网络安全">网络安全</option>
                        <option value="MySQL">MySQL</option>
                        <option value="Oracle">Oracle</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">选择提问章节</label>
                <div class="layui-inline">
                    <select name="section" lay-filter="section">
                        <option value="请选择提问章节"></option>
                        <option value="第一章">第一章</option>
                        <option value="第二章">第二章</option>
                        <option value="第三章">第三章</option>
                        <option value="第一章">第四章</option>
                        <option value="第二章">第五章</option>
                        <option value="第三章">第六章</option>
                    </select>

                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">选择提问教师</label>
                <div class="layui-input-inline">
                    <select name="teacher" lay-filter="teacher">
                        <option value="请选择提问教师"></option>
                        <c:forEach items="${teacherLists}" var="list">
                            <option value="${list.teacherNumber}">${list.teacherName}</option>
                        </c:forEach>
                    </select>
                </div>
            </div>

            <div class="layui-form-item layui-form-text">
                <div class="layui-input-block">
                    <textarea id="content" name="content" lay-verify="content" placeholder="请输入提问内容"
                              class="layui-textarea layui-hide"></textarea>
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <div class="layui-input-block">
                    <i class="layui-icon">&#xe67c;</i>上传附件 <input type="file" class="layui-btn" name="blFile" size="8"/>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="submit" class="layui-btn" lay-filter="" lay-submit>立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
<%@ include file="footer.jsp" %>

<script src="../static/layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述 JS 路径需要改成你本地的 -->
<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        //创建一个编辑器
        var editIndex = layedit.build('LAY_demo_editor');

        //自定义验证规则
        form.verify({
            title: function (value) {
                if (value.length < 5) {
                    return '标题至少得5个字符啊';
                }
            }
            , pass: [
                /^[\S]{6,12}$/
                , '密码必须6到12位，且不能出现空格'
            ]
            , content: function (value) {
                layedit.sync(editIndex);
            }
        });

        //监听指定开关
        form.on('switch(switchTest)', function (data) {
            layer.msg('开关checked：' + (this.checked ? 'true' : 'false'), {
                offset: '6px'
            });
            layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
        });
    });
</script>

</body>
</html>